package com.huhu.scenes;

import org.andengine.engine.camera.Camera;
import org.andengine.entity.sprite.Sprite;
import org.andengine.opengl.util.GLState;

import com.huhu.GameActivity;
import com.huhu.base.BaseScene;
import com.huhu.manager.SceneManager.SceneType;

public class SplashScene extends BaseScene{
	private Sprite splash_sprite;

	@Override
	public void createScene() {
		splash_sprite = new Sprite(0, 0, resourcesManager.splash_region, vbom){
			@Override
			protected void preDraw(GLState pGLState, Camera pCamera) {
				// TODO Auto-generated method stub
				super.preDraw(pGLState, pCamera);
				pGLState.enableDither();
			}
		};
		
//		splash_sprite.setScale(1.5f);
		splash_sprite.setPosition(GameActivity.CAMERA_WIDTH/2 - splash_sprite.getWidth()/2, GameActivity.CAMERA_HEIGHT/2 - splash_sprite.getHeight()/2);
		attachChild(splash_sprite);
	}

	@Override
	public void onBackKeyPressed() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public SceneType getSceneType() {
		// TODO Auto-generated method stub
		return SceneType.SPLASH;
	}

	@Override
	public void disposeScene() {
		splash_sprite.detachSelf();
		splash_sprite.dispose();
		this.detachSelf();
		this.dispose();
	}

}
